import matplotlib.pyplot as plt
import pandas as pd
df = pd.read_excel('学生各学期成绩表.xlsx')
plt.rcParams['figure.figsize'] = (10,6)
plt.rcParams['font.sans-serif'] = 'SimHei'
plt.rcParams['xtick.direction'] = 'in'
plt.rcParams['ytick.direction'] = 'in'
plt.title('学生各学期成绩分析')
plt.xlabel('学期')
plt.ylabel('成绩')
plt.xticks(rotation=15)
plt.grid()
x = df['学期']
plt.plot(x, df['语文'],'--^')
plt.plot(x, df['数学'],'-.o')
plt.plot(x, df['英语'],'r:d')
plt.legend(['语文','数学','英语'])
plt.show()